package com.example.admin.model.dto;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;

import java.util.List;

@Data
public class BasePage {

    private long current;

    private long size;

    private List<OrderItem> orders;

    public <T> Page<T> getPage() {
        Page<?> page = new Page<>(current, size);
        if (orders != null) {
            page.setOrders(orders);
        }
        return (Page<T>) page;
    }

}
